home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / SERIUS / SERIUS_F / ABOUT_C_.EXA
Text File  |  1992-01-23  |  3KB  |  45 lines

  1. These files include the current version of the "OIP.h" file as well as a THINK C 5.0 library entitled: "OIPLib.TC". Also included are THINK C 5.0 examples of the Text Length and Concatenate functions as well as an additional Append Text function. The folder entitled "Serius #includes" and the file "OIPLib.TC" should be placed in the same folder as THINK C before compiling these examples.
  2.  
  3. The Text Length function has a text object input parameter and a number object output parameter which upon exit contains the length of text in the text object. We are including it to illustrate how a number object is assigned a value.
  4.  
  5. The functions, Concatenate and Append Text both join together the data of two text objects. However, they accomplish this differently. Concatenate joins two text inputs and produces a text output. Append Text, on the other hand, has no output but rather appends input 2 onto input 1. Thus, Concatenate demonstrates text manipulation to produce an output parameter whereas Append Text is an example of how to change the data of an input parameter.
  6.  
  7. We have also provided test worksheets that use both functions. A configuration file containing Append Text is also included and should be added to your Objects Folder. We are providing it since Concatenate is already among the Text object functions and Append Text is not.
  8.  
  9. There are five of the OIP routines documented in the Developer manual (shipped with Serius Developer) that cannot be safely called from C. We have written some "glue" code that will allow you to access them. This is accoplished by using the following C names instead of the Pascal names when calling them.
  10.  
  11.         Pascal Name                             C Name
  12.  
  13.     GetObjectTypeName                 C_GetObjectTypeName
  14.     GetIndObject                            C_GetIndObject
  15.     GetObjectFromRef                    C_GetObjectFromRef
  16.     GetParameter                           C_GetParameter
  17.     CreateObject                            C_CreateObject
  18.  
  19. WITH PARAMETERS
  20.  
  21.     pascal void C_GetObjectTypeName(Str255 theName, long theTypeID)
  22.     pascal Str255 GetObjectTypeName(long theTypeID)
  23.  
  24.     pascal void C_GetIndObject(ObjectPtr theObject, long theTypeID,
  25.                                     long theObjectIndex)
  26.     pascal ObjectRecord GetIndObject(long theTypeID, long theObjectIndex)
  27.  
  28.     pascal void C_GetObjectFromRef(ObjectPtr theObject, ObjectRefPtr theRef)
  29.     pascal ObjectRecord GetObjectFromRef(ObjectRefPtr theRef)
  30.  
  31.     pascal void C_GetParameter(ObjectRefPtr theObjectRef, long parameterIndex)
  32.     pascal ObjectReference GetParameter(long parameterIndex)
  33.  
  34.     pascal void C_CreateObject(ObjectPtr theObject, long theType)
  35.     pascal ObjectRecord CreateObject(long theType)
  36.  
  37. You should also notice that these routines have been redeclared as Pascal
  38. procedures (void) instead of Pascal functions. In Pascal, functions return a
  39. result and procedures do not. The Pascal result is obtained in the C versions
  40. by passing an additional first parameter. This parameter is a pointer to the
  41. Pascal result. These are the only OIP routines that you need to worry about.
  42. The others all match the Pascal interface.
  43.  
  44. Serius Tech Support
  45.